package Week5.J0513;

import java.util.Arrays;
import java.util.Comparator;

public class 主持人调度一xv {
    public static void main(String[] args) {
        int[][] schedule = {{0,10},{10,20},{20,30}};
        boolean b = hostschedule(schedule);
        System.out.println(b);
    }
    public static boolean hostschedule (int[][] schedule) {
        Arrays.sort(schedule, Comparator.comparingInt(v -> v[0]));

        for (int i = 1; i < schedule.length; i++) {
            if (schedule[i-1][1] > schedule[i][0]) {
                return false;
            }
        }
        return true;
    }
}
